<?php
/**
 * Http代理
 * 
 * 默认的端口是80，默认的超时时间是10秒
 *
 * @package if
 * @subpackage util.net
 * @since 1.1.1
 */
class IHttpProxy {
	const AUTH_BASIC  = "Basic";//1.1.1
    const AUTH_DIGEST = "Digest";//1.1.1
    
    private $host;
    private $port;
    private $user;
    private $password;
    private $authScheme;
    private $name;
    private $timeout = 10;
	
	function __construct($host = null, $port = 80, $user = null, $password = null, $authScheme = self::AUTH_BASIC, $name = null) {
		$this->host = $host;
		$this->port = $port;
		$this->user = $user;
		$this->password = $password;
		$this->authScheme = $authScheme;
		$this->name = $name;
	}
	
	function setHost($host) {
		$this->host = $host;
	}
	
	function host() {
		return $this->host;
	}
	
	function setPort($port) {
		$this->port = intval($port);
	}
	
	function port() {
		return $this->port;
	}
	
	function setUser($user) {
		$this->user = $user;
	}
	
	function user() {
		return $this->user;
	}
	
	function setPassword($password) {
		$this->password = $password;
	}
	
	function password() {
		return $this->password;
	}
	
	function authScheme() {
		return $this->authScheme;
	}
	
	function setName($name) {
		$this->name = $name;
	}
	
	function name() {
		return $this->name;
	}
	
	function setTimeout($timeout) {
		$this->timeout = $timeout;
	}
	
	function timeout() {
		return $this->timeout;
	}
}

?>